package com.haixiaoke.saas.workOrder.service.impl;

import java.util.List;

import com.haixiaoke.saas.common.utils.DateUtils;
import com.haixiaoke.saas.workOrder.domain.WorkOrderChargeItem;
import com.haixiaoke.saas.workOrder.mapper.WorkOrderChargeItemMapper;
import com.haixiaoke.saas.workOrder.service.IWorkOrderChargeItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 维修收费项目Service业务层处理
 * 
 * @author panda
 * @date 2024-09-02
 */
@Service
public class WorkOrderChargeItemServiceImpl implements IWorkOrderChargeItemService {
    @Autowired
    private WorkOrderChargeItemMapper workOrderChargeItemMapper;

    /**
     * 查询维修收费项目
     * 
     * @param workOrderChargeItemId 维修收费项目主键
     * @return 维修收费项目
     */
    @Override
    public WorkOrderChargeItem selectWorkOrderChargeItemByWorkOrderChargeItemId(Long workOrderChargeItemId) {
        return workOrderChargeItemMapper.selectWorkOrderChargeItemByWorkOrderChargeItemId(workOrderChargeItemId);
    }

    /**
     * 查询维修收费项目列表
     * 
     * @param workOrderChargeItem 维修收费项目
     * @return 维修收费项目
     */
    @Override
    public List<WorkOrderChargeItem> selectWorkOrderChargeItemList(WorkOrderChargeItem workOrderChargeItem) {
        return workOrderChargeItemMapper.selectWorkOrderChargeItemList(workOrderChargeItem);
    }

    /**
     * 新增维修收费项目
     * 
     * @param workOrderChargeItem 维修收费项目
     * @return 结果
     */
    @Override
    public int insertWorkOrderChargeItem(WorkOrderChargeItem workOrderChargeItem) {
        workOrderChargeItem.setCreateTime(DateUtils.getNowDate());
        return workOrderChargeItemMapper.insertWorkOrderChargeItem(workOrderChargeItem);
    }

    @Override
    public int insertBatchWorkOrderChargeItem(List<WorkOrderChargeItem> workOrderChargeItemList) {
        return workOrderChargeItemMapper.insertBatchWorkOrderChargeItem(workOrderChargeItemList);
    }

    /**
     * 修改维修收费项目
     * 
     * @param workOrderChargeItem 维修收费项目
     * @return 结果
     */
    @Override
    public int updateWorkOrderChargeItem(WorkOrderChargeItem workOrderChargeItem) {
        workOrderChargeItem.setUpdateTime(DateUtils.getNowDate());
        return workOrderChargeItemMapper.updateWorkOrderChargeItem(workOrderChargeItem);
    }

    @Override
    public int updateBatchWorkOrderChargeItem(List<WorkOrderChargeItem> workOrderChargeItemList) {
        return workOrderChargeItemMapper.updateBatchWorkOrderChargeItem(workOrderChargeItemList);
    }

    /**
     * 批量删除维修收费项目
     * 
     * @param workOrderChargeItemIds 需要删除的维修收费项目主键
     * @return 结果
     */
    @Override
    public int deleteWorkOrderChargeItemByWorkOrderChargeItemIds(Long[] workOrderChargeItemIds) {
        return workOrderChargeItemMapper.deleteWorkOrderChargeItemByWorkOrderChargeItemIds(workOrderChargeItemIds);
    }

    /**
     * 删除维修收费项目信息
     * 
     * @param workOrderChargeItemId 维修收费项目主键
     * @return 结果
     */
    @Override
    public int deleteWorkOrderChargeItemByWorkOrderChargeItemId(Long workOrderChargeItemId) {
        return workOrderChargeItemMapper.deleteWorkOrderChargeItemByWorkOrderChargeItemId(workOrderChargeItemId);
    }

    @Override
    public int deleteWorkOrderChargeItemByWorkOrderId(String workOrderId) {
        return workOrderChargeItemMapper.deleteWorkOrderChargeItemByWorkOrderId(workOrderId);
    }

    @Override
    public List<WorkOrderChargeItem> selectWorkOrderChargeItemByWorkOrderId(String workOrderId) {
        return workOrderChargeItemMapper.selectWorkOrderChargeItemByWorkOrderId(workOrderId);
    }

    @Override
    public List<WorkOrderChargeItem> selectWorkOrderChargeItemByWorkOrderIds(List<String> workOrders) {
        return workOrderChargeItemMapper.selectWorkOrderChargeItemByWorkOrderIds(workOrders);
    }
}
